﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>新建徽章</title>
    <script src="/Scripts/common/common.js" type="text/javascript"></script>
    <script src="/Scripts/site/bgmgr/badgecfg/new.js" type="text/javascript"></script>
</head>
<body>
    <ext:ResourceManager runat="server" />
    <ext:Viewport runat="server" Layout="fit">
        <Items>
            <ext:FormPanel ID="BadgeForm" runat="server" IDMode="Explicit" Border="false" Padding="3"
                Url="/BgMgr/BadgeConfig/AddBadge">
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:Button IDMode="Explicit" runat="server" Text="保存" Icon="Disk">
                                <Listeners>
                                    <Click Handler="if (#{BadgeForm}.form.isValid()) {#{BadgeForm}.form.submit({waitMsg:'保存中...', success: successHandler, failure: failureHandler});} else {Ext.Msg.show({title:'错误', icon: Ext.MessageBox.ERROR, msg: '请检查表单是否填写正确。', buttons:Ext.Msg.OK});}" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:TextField ID="BadgeName" runat="server" FieldLabel="徽章名称" AnchorHorizontal="90%" AllowBlank="false" MaxLength="20" />
                    <ext:TextField ID="BadgeImage" runat="server" FieldLabel="徽章图片路径" AnchorHorizontal="90%" MaxLength="50">
                        <Listeners>
                            <Change Handler="BadgePic.setImageUrl(BadgeImage.getValue());" />
                        </Listeners>
                    </ext:TextField>
                    <ext:Image ID="BadgePic" runat="server" ImageUrl="/resources/images/blank.gif" Width="100" Height="100" FieldLabel="预览图" />
                    <ext:TextArea ID="BadgeDes" runat="server" FieldLabel="徽章描述" AnchorHorizontal="90%" Height="50" MaxLength="300" />
                    <ext:TextField ID="CheckMethod" runat="server" FieldLabel="检查方法" AnchorHorizontal="90%" MaxLength="20" />
                    <ext:TextField ID="CheckParam" runat="server" FieldLabel="检查参数" AnchorHorizontal="90%" MaxLength="20" />
                    <ext:NumberField ID="AwardCents" runat="server" FieldLabel="奖励积分" AnchorHorizontal="90%" MaxLength="9" MinValue="0" MaxValue="999999999" />
                    <ext:NumberField ID="AwardExperience" runat="server" FieldLabel="奖励成长值" AnchorHorizontal="90%" MaxLength="9" MinValue="0" MaxValue="999999999" />
                    <ext:NumberField ID="Sort" runat="server" FieldLabel="排序" AnchorHorizontal="90%" MaxLength="3" MinValue="0" MaxValue="255" />
                    <ext:ComboBox ID="IsShow" runat="server" FieldLabel="是否显示" Width="70">
                        <SelectedItem Text="显示" Value="1" />
                        <Items>
                            <ext:ListItem Text="显示" Value="1" />
                            <ext:ListItem Text="隐藏" Value="0" />
                        </Items>
                    </ext:ComboBox>
                </Items>
            </ext:FormPanel>
        </Items>
    </ext:Viewport>
</body>
</html>
